﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SpCop.Core.Model;
using SpCop.Model;

namespace SpCop.General.ContentTypes
{
    class ContentTypeIdsAreValid : ElementRuleBase 
    {
        public ContentTypeIdsAreValid()
            : base(a=>a.ElementType == ElementType.ContentType)
        {
            
        }

        protected override void VisitElement(Package package, Feature feature, Element item)
        {
            var id = item.Xml.Attribute("ID").Value;

            // Todo : parse content type by striping the biggest built in content type id and then it should be 00 / guid without dashes.
            // Log problem it doesn't.
            AddProblem("IdMalformed",feature.Title,item.Xml.Attribute("Name").Value);
        }
    }
}
